Please note that this software is provided “as is” and without any express or implied warranties, including, without limitation, the implied warranties of merchantability and fitness for a particular purpose.
Introduction
Welcome to Dialog Dumper v0.6. This is the first public release of the Dialog Dumper applet which is a part of the Dialog Director v0.6 distribution. Dialog Dumper allows you to automatically convert standard Mac OS application dialog boxes into AppleScripts that can be used in conjunction with Dialog Director v0.6 to create interactive dialogs. The advantage of this is that these dialog boxes can be created and edited using Apple’s ResEdit application. ResEdit provides a user interface for the interactive editing of dialog layouts via direct manipulation.
Many thanks to Christopher R. Green for his help in the development and testing of Dialog Dumper.
What You Get
This document provides a very brief description of the current features and functions of Dialog Dumper. Dialog Dumper is supplied as both an applet and the entire text of the script for that applet & the resource file containing the dialog resources used to generate its user interface. You are free to customise it to your own particular needs. To create the applet the script was saved from the Script Editor as a ‘Run Only’ application, with ‘Stay Open’ and ‘Never Show Startup Screen’ options checked, and the minimum and preferred memory requirements set to 600K. A couple of example dialog resource files are also included.
What You Need to Run
To use Dialog Dumper you are required to have the following scripting additions installed on your computer:
Dialog Dumper reads each ‘DLOG’ resource in turn from a resource file and processes its contents and the contents of an associated ‘DITL’ resource. It also extracts information from ‘CNTL’ and ‘MENU’ resources referenced by dialog items in a ‘DITL’ resource. It is possible to use Dialog Dumper to convert dialogs taken directly from applications, desk accessories, etc. However, they should be copied into a new resource file before use.
This release of Dialog Dumper supports the following Dialog Director features through the user interface:
• choice of Auto Dialog or Live Dialog code generation
• optional greyscale dialog look
• optional timeout for Auto Dialogs
• optionally change the default text font
• optionally change the default text size
• optionally change the default text style.
Dialog Dumper uses the following information from the ‘DLOG’ resource in its code generation:
• the name of the resource (prefixed with “d”) for name of the variable containing the dialog record
• or the resource ID prefixed with “dlog” if there is no name;
• the DLOG’s boundsRect for the dialog bounds
• or the boundsRect’s width & height for the dialog size if the top-left is (0, 0);
• the DLOG’s title for the dialog’s name;
• the DLOG’s procID for the dialog’s style;
• and the DLOG’s DITL ID to retrieve the ‘DITL’ resource for the dialog’s contents.
Dialog Dumper generates code for the following dialog item classes. This information is extracted from the ‘DITL’ resource:
• push button
• check box
• radio group - by grouping together adjacent radio buttons
• static text
• text field
• icon
• picture
• group box - from user items and control:
title Æ name
procID = 160 Æ primary group
procID = 164 Æ secondary group
• pop up - from control:
title Æ name
value ≠ 0 Æ value
title ≠ “” and max ≠ 0 Æ name width: max
procID = 400 or 1008 Æ standard pop-up, min Æ menu resource ID used for contents:[…]
procID = 400 or 1008 and title = “” and refCon ≠ 0 Æ text field: refCon
procID = 404 or 1012 Æ resource list pop-up, refCon Æ resource type
• list box - from control:
procID = 352
value ≠ 0 Æ value
• gauge - from control:
value ≠ 0 Æ value
max - min Æ max value.
How to Use It
To use Dialog Dumper simply drop the resource file containing the dialog(s) on the Dialog Dumper application icon (or launch Dialog Dumper and select an appropriate file). You will be presented with the following dialog (or something similar):
See the Dialog Director User Guide for details of the meanings of the settings. Make your settings and then click To Clipboard to write the script to the clipboard, or To File… to write the script to a file of your choosing. If the script is written to a file then any existing file will be completely overwritten. Any settings you make are preserved and re-presented the next time a file is to be processed. Dialog Dumper stays open after processing a file so it does not need to be relaunched each time it is needed.
If the Live Mode option is selected then the script generated contains a loop that repeats until a push button in the dialog is pressed.